<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  <title>Hangzhou Rent Heatmap</title>

  <script type="text/javascript" src="modernizr-1.6.min.js"></script>
  <script type="text/javascript" src="http://ditu.google.cn/maps/api/js?sensor=false"></script>
  <script type="text/javascript" src="heatcanvas.js"></script>
  <script type="text/javascript" src="heatcanvas-googlemaps.js"></script>
  <script type="text/javascript" src="heatcanvas-worker.js"></script>
  <script type="text/javascript" src="heatSlider.js"></script>

  <script type="text/javascript" src="js/jquery-1.6.2.min.js"></script>
  <script type="text/javascript" src="canvas2image.js"></script>
  <script type="text/javascript" src="base64.js"></script>

  <style type="text/css">
    body{cursor:auto;}
    #map{}
    #wait_logo{
      position: absolute;
      top : 300px;
      left: 450px;
      z-index : 10;
      display:inline;
    }
  </style>

  <script type="text/javascript">
    var HeatOverlay=undefined;
    var defaultrangemin=400;
    var defaultrangemax=4000;
    var originmin=800;
    var originmax=3500;
    var slider;


    function refresh(){
      var node=document.getElementById("map");
      while (node.hasChildNodes()) {
        node.removeChild(node.lastChild);
      }
      $('#debug').show();
      $('#pageControl').show();
      $('#titleImg').show();
      init();

      $('#debug').hide();
      $('#pageControl').hide();
      $('#titleImg').hide();
    };

    function init() {
      $("#map").css({
        width:  Math.max(1080, $(window).width()) - 17,
        height: Math.max(700, $(window).height()) - 17
      });
      if (!Modernizr.canvas) {
        $('#debug').hide();
        $('#pageControl').hide();
        $('#titleImg').hide();
        $('#wait_logo').hide();
        document.getElementById("map").innerHTML="<p>Your browser does not support canvas. Please use <a id=\"a\" target=\"blank\" href=\"https://www.google.com/chrome\">Chrome</a>  <a id=\"b\" target=\"blank\" href=\"http://www.firefox.com\">Firefox</a>  <a id=\"c\" target=\"blank\" href=\"http://www.apple.com/safari/\">Safari</a>  <a id=\"d\" target=\"blank\" href=\"http://www.opera.com\">Opera</a> to view this site.</p>                        <p>����������֧��canvas. ��ʹ�� <a id=\"a\" target=\"blank\" href=\"https://www.google.com/chrome\">Chrome</a>  <a id=\"b\" target=\"blank\" href=\"http://www.firefox.com\">Firefox</a>  <a id=\"c\" target=\"blank\" href=\"http://www.apple.com/safari/\">Safari</a>  <a id=\"d\" target=\"blank\" href=\"http://www.opera.com\">Opera</a>��������������վ�㡣</p>";
        return;
      }


      var latlng = new google.maps.LatLng(30.28, 120.15);
      var myoptions = {
        zoom: 12,
        center: latlng,
        maxZoom: 18,
        minZoom: 10,
        mapTypeId: google.maps.MapTypeId.ROADMAP,
        streetViewControl: false,
        // navigationControlOptions: {style: google.maps.NavigationControlStyle.SMALL},
        mapTypeControl: true,
        mapTypeControlOptions: {
          style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
          position: google.maps.ControlPosition.LEFT_TOP
        },
        navigationControl: true,
        navigationControlOptions: {
          style: google.maps.NavigationControlStyle.ZOOM_PAN,
          position: google.maps.ControlPosition.LEFT
        },
        scaleControl: true,
        scaleControlOptions: {
          position: google.maps.ControlPosition.LEFT_BOTTOM
        }
      };
      var map = new google.maps.Map(document.getElementById("map"), myoptions);
      //map.setOptions({ draggableCursor:'url(images/fly.cur), move' });
      //map.setOptions({ draggableCursor: 'auto' });
      var heatmap = new HeatCanvasOverlayView(map, {'opacity':1.0, 'min':defaultrangemin, 'max':defaultrangemax,});//'opacity':0.8
      HeatOverlay=heatmap;

      var interval = {
        lat: 0.0025,
        lng: 0.0025,
      };
      heatmap.interval=interval;
      var data=[[30.28,120.1,1253], [30.31,120.1725,1187], [30.1825,120.17,1554], [30.2975,120.16,2062], [30.31,120.1525,1193], [30.31,120.09,1022], [30.2725,120.2125,1269], [30.28,120.1625,2452], [30.3175,120.155,1167], [30.33,120.1475,1125], [30.28,120.1425,1292], [30.2825,120.0925,1393], [30.2675,120.1325,1264], [30.3525,120.295,1039], [30.25,120.1925,1603], [30.2675,120.145,1241], [30.2175,120.2275,1426], [30.21,120.1725,1235], [30.26,120.1825,1667], [30.2475,120.1725,1720], [30.32,120.16,1372], [30.2825,120.11,1702], [30.2875,120.1525,1432], [29.6,119.055,1745], [30.275,120.1025,1152], [30.1825,120.165,1690], [30.27,120.2125,1273], [30.3,120.155,1145], [30.27,120.15,1506], [29.6025,119.055,1734], [30.2725,120.14,2168], [30.2975,120.1425,1054], [30.18,120.135,1109], [30.285,120.1325,1369], [30.2725,120.12,1193], [30.29,120.145,1377], [30.345,120.185,714], [30.1775,120.2725,1588], [30.2275,120.1725,1456], [30.2775,120.1825,1430], [30.265,120.1725,2301], [30.2075,120.1675,1374], [30.0075,120.0025,1480], [30.045,119.9525,1632], [30.2825,120.155,1588], [30.275,120.105,1129], [30.315,120.1425,1341], [30.3025,120.1325,1520], [30.2325,120.025,1044], [30.2925,120.145,1349], [30.285,120.135,2546], [30.175,120.1625,834], [30.2775,120.11,1347], [29.6,119.0525,1745], [30.2775,120.09,1325], [30.31,120.265,775], [30.2925,120.1625,1346], [30.305,120.15,1021], [30.275,120.0925,1499], [30.185,120.135,1153], [30.18,120.1325,1124], [30.3375,120.085,962], [30.2875,120.12,1330], [30.315,120.145,1253], [30.3075,120.135,1233], [30.2575,120.13,1386], [30.1825,120.1725,1554], [30.0575,119.9475,1402], [30.2675,120.16,1843], [30.3125,120.265,785], [30.2325,120.19,1416], [30.28,120.13,2632], [30.2825,120.0825,2131], [30.265,120.1275,3545], [30.28,120.135,1113], [30.285,120.2025,1522], [30.2825,120.14,1604], [30.32,120.0875,740], [30.22,120.1875,2866], [30.2925,120.13,1388], [30.27,120.1175,1171], [30.335,120.09,784], [30.2625,120.2025,1327], [30.3175,120.18,853], [30.295,120.3875,650], [30.2375,120.1875,1287], [30.2875,120.1175,1422], [30.325,120.0925,856], [30.22,120.185,2890], [30.19,120.21,1191], [30.2575,120.2025,1200], [29.855,119.7725,956], [30.31,120.1275,1115], [30.2225,120.185,1661], [30.26,120.22,1742], [30.3025,120.17,1248], [30.235,120.2,1367], [30.2525,120.2,1343], [30.58,119.61,1122], [30.2925,120.195,1039], [30.2025,120.21,1146], [30.235,120.2025,1410], [30.1675,120.1475,860], [30.2425,120.19,1281], [30.2825,120.185,1531], [30.255,120.18,1799], [30.33,120.0875,887], [30.2875,120.1275,1185], [30.245,120.17,1740], [30.2975,120.1575,2085], [30.295,120.1075,1335], [30.2175,120.2675,1172], [30.275,120.195,1136], [30.17,120.145,869], [30.2575,120.17,2089], [30.2675,120.165,1611], [30.305,120.1575,1130], [30.3325,120.1025,825], [30.205,120.2675,1458], [30.23,120.2075,2075], [30.2675,120.2,1176], [30.2575,120.195,1325], [30.245,120.2,1143], [30.19,120.2025,1056], [30.5775,119.6075,1122], [29.49,119.33,5021], [30.2475,120.185,1668], [30.26,120.175,1915], [30.32,120.1125,1614], [30.2825,120.1775,1743], [30.28,120.17,1954], [30.25,120.165,1575], [30.2875,120.095,1304], [30.2725,120.1675,1480], [30.185,120.15,952], [30.4175,120.3025,1765], [30.27,120.205,1327], [30.27,120.185,1593], [30.2225,120.1775,1208], [30.2425,120.175,1533], [30.29,120.1225,1132], [29.9275,120.35,1508], [30.21,120.17,1307], [30.2525,120.1875,1578], [30.27,120.1775,2439], [30.2125,120.17,1234], [30.2525,120.165,2665], [30.27,120.1575,1918], [30.28,120.1525,2015], [30.2775,120.1075,1350], [30.2875,120.1025,1473], [30.2025,120.2125,1220], [30.26,120.1675,2037], [30.3075,120.1375,1149], [30.25,120.1975,1500], [30.2725,120.185,2078], [30.265,120.175,1887], [30.1425,120.12,1687], [30.275,120.1125,1310], [30.28,120.1875,1426], [30.2475,120.1775,2335], [30.235,120.17,1239], [30.2925,120.115,1915], [30.305,120.1025,1354], [30.23,120.47,944], [30.3175,120.1675,1405], [30.3225,120.35,1904], [30.2825,120.105,1543], [30.3175,120.1475,863], [30.315,120.1375,1197], [30.255,120.1325,1452], [30.255,120.205,1940], [30.2775,120.1925,1252], [30.335,120.19,1004], [30.285,120.1,1232], [30.3075,120.1825,1069], [30.255,120.1775,1561], [30.2625,120.125,1263], [30.275,120.115,1233], [30.275,120.095,1571], [30.2575,120.2125,1334], [30.305,120.1675,1105], [30.265,120.1625,1711], [30.2925,120.1375,1479], [30.2725,120.1325,4093], [30.255,120.1925,1357], [30.23,120.175,1794], [30.215,120.1725,1282], [30.2775,120.1,1225], [30.2525,120.1725,2871], [30.285,120.16,1106], [30.235,119.705,1161], [30.2925,120.1525,1734], [30.2925,120.19,1426], [30.185,120.165,1678], [30.2825,120.1675,1396], [30.315,120.155,1165], [30.3225,120.1475,1347], [30.2825,120.1425,1227], [30.285,120.0925,1407], [30.27,120.1325,2216], [30.2925,120.1925,1164], [30.35,120.295,1039], [30.005,120.0,1480], [30.2775,120.135,1218], [30.2325,120.1725,1412], [30.2625,120.1825,2000], [30.25,120.1725,2404], [30.3175,120.16,1372], [30.1825,120.1625,1690], [30.29,120.11,1232], [30.29,120.1525,1326], [30.32,120.3475,1904], [30.2775,120.1025,1190], [30.2275,120.4675,944], [30.26,120.1625,1565], [30.2975,120.155,1288], [30.2675,120.15,1500], [30.27,120.105,1252], [30.28,120.14,1287], [30.3,120.1425,1425], [30.1775,120.1375,1510], [30.1775,120.135,1339], [30.2875,120.1325,3305], [30.28,120.12,1212], [30.2875,120.145,1249], [30.3425,120.185,979], [30.3,120.135,1823], [30.23,120.1725,1859], [30.33,120.1875,868], [30.28,120.1825,1427], [30.22,120.225,1426], [30.2675,120.1725,2779], [30.21,120.1675,1386], [30.26,120.16,1987], [30.295,120.3375,664], [30.3175,120.1625,1344], [30.2725,120.105,1122], [30.3175,120.1425,1442], [30.2925,120.12,1427], [30.31,120.145,1285], [30.2825,120.135,1237], [30.42,120.3,1579], [30.2725,120.16,1297], [30.325,120.095,916], [30.3075,120.265,743], [30.2375,120.1975,1218], [30.3025,120.15,969], [30.315,120.14,1334], [30.2775,120.0925,1389], [30.1825,120.135,1102], [30.3125,120.145,1268], [30.305,120.135,1221], [30.185,120.1725,1552], [30.1425,120.1575,579], [30.265,120.0975,1245], [30.1975,120.2225,970], [30.285,120.15,1562], [30.2975,120.335,664], [30.24,120.19,1327], [30.2775,120.13,1300], [30.285,120.0825,1076], [30.2875,120.2025,1661], [29.9275,120.3475,1508], [30.29,120.14,1267], [30.3,120.13,1556], [30.35,120.1825,841], [30.3175,120.2575,1037], [30.3325,120.09,1218], [30.265,120.2025,1241], [29.9325,119.925,1183], [30.24,120.1875,1275], [30.3125,120.13,1221], [30.4675,120.3075,1120], [30.29,120.1175,1444], [29.93,120.35,1508], [30.2925,120.2075,1270], [30.2425,120.2025,1376], [30.295,120.19,1183], [30.3275,120.0925,838], [30.305,120.2625,736], [30.2175,120.185,5133], [30.3375,120.0825,962], [30.2875,120.17,1179], [30.1425,120.16,579], [30.3325,120.1375,1199], [30.1875,120.21,1191], [30.26,120.2025,1312], [30.2675,120.19,1432], [29.8575,119.7725,956], [30.24,120.185,1270], [30.2575,120.22,1745], [30.31,120.17,1171], [30.22,120.22,1105], [30.2575,120.2075,1538], [30.2825,120.115,1801], [30.5775,119.61,1122], [30.29,120.195,1574], [30.2375,120.2025,1464], [30.17,120.1475,860], [30.25,120.19,1553], [30.2525,120.18,1482], [30.3225,120.0875,803], [30.2925,120.175,1950], [30.29,120.1275,1219], [30.1825,120.1875,961], [30.2425,120.17,1804], [30.3,120.1575,1163], [30.2875,120.1075,1293], [30.215,120.27,1172], [30.27,120.21,1300], [30.2725,120.2,1373], [30.1925,120.155,1254], [30.1875,120.1475,982], [30.1675,120.145,869], [30.2875,120.195,1767], [30.2675,120.1275,3653], [30.29,120.1875,2175], [30.24,120.1825,1169], [30.3175,120.1775,854], [30.2525,120.215,3868], [30.265,120.17,2077], [30.265,120.165,1708], [30.3175,120.1575,1173], [30.185,120.1575,1783], [30.255,120.195,1384], [30.3125,120.2675,830], [30.1925,120.2025,1051], [30.58,119.6075,1122], [30.245,120.185,1530], [30.2575,120.175,1950], [30.285,120.1775,1500], [30.2425,120.165,1646], [30.2775,120.17,2221], [30.2475,120.165,1835], [30.285,120.095,1343], [30.1875,120.2125,1191], [30.275,120.1675,1881], [30.1825,120.15,1105], [30.275,120.1475,1336], [30.42,120.3025,1579], [30.2675,120.205,1274], [30.2675,120.185,1424], [30.225,120.1775,1433], [30.28,120.175,2400], [30.255,120.1875,1694], [30.2625,120.1775,1879], [30.315,120.125,1073], [22.565,113.885,1292], [30.28,120.1075,1517], [30.29,120.1025,1321], [30.205,120.2125,1194], [30.2525,120.1675,3135], [30.2075,120.205,1090], [30.42,120.11,1847], [30.2925,120.1475,1647], [30.4675,120.305,1120], [30.25,120.205,1302], [30.2825,120.1925,1297], [30.2625,120.175,1845], [30.2775,120.1125,1316], [30.31,120.1,1351], [30.2725,120.1875,2181], [30.25,120.1775,2283], [30.3,120.1725,1113], [30.2325,120.17,1409], [30.29,120.115,1924], [30.3075,120.1025,1367], [30.2275,120.47,944], [30.285,120.155,1437], [30.1625,120.41,1229], [30.2675,120.155,1769], [30.32,120.1475,1269], [30.33,120.14,1158], [30.2875,120.1375,2750], [30.145,120.3325,1312], [30.2575,120.1325,1333], [30.2525,120.205,1823], [30.27,120.1975,1323], [30.28,120.1925,1292], [30.2825,120.1,1326], [30.31,120.1825,1150], [30.28,120.125,1538], [30.295,120.165,1214], [30.2725,120.115,1167], [30.2725,120.095,1341], [30.2925,120.16,1349], [30.26,120.2125,1314], [30.2675,120.1625,1623], [30.2675,120.1425,1227], [30.295,120.1375,1112], [30.275,120.1325,1409], [30.2875,120.1975,1671], [30.2575,120.1925,1411], [30.2275,120.175,1517], [30.255,120.1725,1634], [30.2375,120.1675,1020], [30.2825,120.16,1337], [30.2325,119.705,1161], [30.295,120.1525,1873], [30.325,120.1475,990], [30.285,120.1425,1207], [30.2875,120.0925,1312], [30.285,120.085,1061], [30.3375,120.185,888], [30.275,120.135,3315], [30.235,120.1725,1290], [30.265,120.1825,2005], [30.2725,120.1725,1652], [30.305,120.16,1134], [30.185,120.1625,1678], [30.28,120.1025,1244], [30.23,120.4675,944], [30.3025,120.1625,1229], [30.295,120.155,1897], [30.275,120.15,1221], [30.2675,120.105,1221], [30.3025,120.1425,1350], [30.305,120.0925,1463], [30.175,120.135,1357], [30.29,120.1325,3275], [30.3325,120.0775,802], [30.2775,120.12,2226], [30.285,120.145,1339], [30.2975,120.135,1709], [30.2175,120.225,1420], [30.27,120.1725,1751], [30.27,120.11,1461], [30.32,120.1625,1372], [30.32,120.1425,1526], [30.4175,120.3,1765], [30.28,120.16,1455], [30.3225,120.095,916], [30.195,120.2225,971], [30.305,120.265,736], [30.2975,120.1625,1160], [30.24,120.1975,1130], [30.31,120.15,1363], [30.28,120.0925,1047], [30.035,120.1475,863], [30.33,120.145,1124], [30.2325,120.2025,1385], [30.2775,120.0975,1539], [22.5625,113.8825,1292], [30.2825,120.15,1368], [30.295,120.14,1070], [30.295,120.335,664], [30.2375,120.19,1341], [29.615,119.55,1795], [30.285,120.13,1159], [30.335,120.1825,806], [30.24,120.195,1159], [29.93,120.3475,1508], [30.2875,120.14,974], [30.28,120.18,1444], [30.335,120.0925,848], [30.3525,120.1825,876], [30.32,120.2575,1037], [30.1325,120.1675,857], [30.2675,120.2025,1200], [30.2325,120.1875,1334], [30.2825,120.1175,1426], [30.295,120.2075,1270], [30.3275,120.1375,1232], [29.81,119.675,1237], [30.245,120.2025,1132], [30.24,120.1925,1390], [29.49,119.3275,5021], [30.285,120.18,1824], [30.3175,120.1275,1073], [30.3075,120.2625,736], [30.18,120.1875,961], [30.34,120.0825,962], [30.295,120.17,1630], [30.2925,120.125,1314], [30.1925,120.16,2806], [30.2725,120.2075,1230], [30.275,120.19,1527], [30.2775,120.18,1453], [30.3375,120.0875,758], [30.305,120.1275,1555], [30.2375,120.185,1240], [30.3075,120.17,1164], [30.2175,120.22,1105], [30.255,120.21,1559], [30.26,120.2075,1565], [30.2575,120.2,1381], [29.93,119.9275,1183], [30.26,120.2,1533], [30.2475,120.19,1102], [30.26,120.18,1860], [30.325,120.0875,903], [30.29,120.175,1584], [30.2825,120.1275,2452], [30.18,120.185,961], [30.25,120.17,1605], [30.29,120.1075,1305], [29.5625,119.3725,1385], [30.2675,120.21,1135], [30.27,120.1275,2038], [30.2825,120.1875,1413], [30.1825,120.185,961], [30.25,120.215,3868], [30.2625,120.17,1970], [30.2625,120.165,1695], [30.1875,120.1525,1161], [30.2525,120.195,1505], [30.33,120.105,901], [30.2775,120.1375,2925], [30.1875,120.145,945], [30.215,120.18,2638], [30.255,120.175,1536], [30.2975,120.1775,1095], [30.31,120.125,964], [30.24,120.16,2105], [30.2825,120.095,1871], [30.1775,120.2675,2718], [30.19,120.2125,1150], [30.2675,120.1675,2115], [30.2025,120.2075,1137], [30.3325,120.105,845], [30.2675,120.1475,1306], [30.4225,120.3025,1207], [30.265,120.205,1259], [30.265,120.185,1545], [30.2375,120.1775,1456], [30.2775,120.175,2420], [30.295,120.1225,1013], [30.2825,120.1125,1809], [30.2475,120.1875,1304], [30.265,120.1775,1935], [30.3075,120.165,1124], [30.265,120.1575,2119], [30.2725,120.1075,1202], [30.2925,120.1025,1250], [30.305,120.095,1356], [30.2575,120.2175,1721], [30.255,120.1675,3337], [30.205,120.205,1120], [30.4175,120.11,1847], [30.295,120.1475,1209], [30.3025,120.1375,995], [30.465,120.305,1120], [30.285,120.1925,1281], [30.22,120.175,1224], [30.2725,120.1225,1317], [30.28,120.1125,1734], [30.3075,120.1,1369], [30.275,120.1875,1953], [30.2425,120.1775,1401], [30.24,120.17,1772], [30.29,120.165,1394], [30.31,120.1025,1378], [30.19,120.165,840], [30.265,120.155,1426], [30.2975,120.105,1030], [30.3125,120.1475,1507], [30.3275,120.14,1139], [30.29,120.1375,1510], [30.1475,120.3325,1312], [30.26,120.1325,1292], [30.2625,120.1975,1556], [30.2625,120.1925,1460], [30.2275,119.7125,1330], [30.29,120.1,1256], [30.3125,120.1825,990], [30.2775,120.125,1561], [30.2925,120.165,1205], [30.27,120.115,1201], [30.27,120.095,1368], [30.2825,120.08,2422], [30.1625,120.4075,1229], [30.27,120.1625,1514], [30.27,120.1425,1427], [30.2775,120.1325,1342], [30.32,120.085,763], [30.26,120.1925,1367], [30.225,120.175,1516], [30.25,120.1825,1419], [30.2575,120.1725,1705], [30.26,120.125,1250], [30.29,120.16,1297], [30.2975,120.1525,1466], [30.3125,120.09,1022], [30.31,120.155,1180], [30.2875,120.1425,1286], [30.295,120.1325,1289], [30.2825,120.085,1061], [30.28,120.145,1398], [30.335,120.185,829], [30.2725,120.135,3652], [30.2375,120.1725,1528], [30.3375,120.1875,972], [30.2675,120.1825,1406], [30.275,120.1725,2273], [30.3025,120.16,1155], [30.1875,120.1625,1128], [22.5625,113.885,1292], [30.2925,120.155,1736], [30.2725,120.15,1325], [30.1725,120.1375,1412], [30.1725,120.135,1412], [30.3125,120.1325,1364], [30.335,120.0775,802], [30.2825,120.145,1386], [30.235,120.18,1243], [30.295,120.135,1188], [30.4225,120.3,1207], [30.28,120.08,2423], [30.2825,120.1625,2096], [30.3225,120.1425,1179], [30.31,120.1325,1306], [30.3275,120.085,832], [29.565,119.375,1385], [30.095,119.235,1690], [30.125,120.28,1681], [30.3425,120.1875,714], [30.2775,120.16,1538], [30.14,120.1575,690], [30.035,120.15,863], [30.2925,120.0975,1368], [30.3,120.1625,1193], [30.2325,120.1975,1311], [30.3075,120.15,1191], [30.27,120.13,2178], [30.055,119.9475,1402], [30.24,120.1625,1862], [30.28,120.0975,1674], [30.29,120.15,1677], [30.2925,120.14,1279], [30.2725,120.18,2365], [29.6125,119.55,1795], [30.2825,120.13,2396], [30.3375,120.1825,890], [30.195,120.22,967], [30.325,120.09,871], [30.2375,120.195,1136], [30.2975,120.385,734], [30.2775,120.1175,1167], [30.3375,120.09,782], [30.27,120.2025,1161], [29.8575,119.775,956], [30.31,120.18,1182], [30.235,120.1875,1292], [30.325,120.0825,825], [30.285,120.1175,1416], [30.33,120.1375,1219], [29.8075,119.675,1237], [30.18,120.21,1088], [30.285,120.0975,1288], [30.3,120.19,1132], [30.2825,120.18,1840], [30.2925,120.17,1628], [30.3325,120.185,881], [30.27,120.135,3233], [30.265,120.18,2274], [30.315,120.17,1401], [30.2875,120.1575,1139], [30.2525,120.2075,2040], [30.19,120.155,1236], [30.285,120.195,1437], [30.1775,120.265,2649], [30.335,120.075,802], [30.2025,120.2025,1075], [30.255,120.19,1368], [30.2575,120.18,1912], [30.2875,120.175,1432], [30.285,120.1275,1091], [30.2975,120.1875,1302], [30.2475,120.17,1641], [30.295,120.1575,2170], [30.2825,120.1075,1730], [29.565,119.3725,1385], [30.215,120.2675,1172], [30.2075,120.2175,1230], [30.1825,120.1475,777], [30.24,120.18,1396], [30.2625,120.1275,1356], [30.285,120.1875,1401], [30.3125,120.1775,1237], [30.27,120.17,2184], [30.28,120.165,2094], [30.19,120.1525,1167], [30.25,120.195,1692], [29.4925,119.33,5021], [30.185,120.145,945], [30.26,120.185,1694], [30.2525,120.175,2057], [30.3,120.1775,1441], [30.3075,120.125,1169], [30.2375,120.16,2185], [30.32,120.115,1621], [30.1225,120.2825,1681], [30.175,120.27,2699], [30.27,120.1675,2226], [30.205,120.2075,1156], [30.1875,120.15,1145], [30.27,120.1475,1460], [30.2625,120.205,1482], [30.2625,120.185,1611], [30.24,120.1775,1361], [30.23,119.715,1439], [30.2975,120.1225,881], [30.285,120.1125,2153], [30.31,120.0925,1022], [30.25,120.1875,1250], [30.2775,120.1775,2096], [30.29,120.125,1220], [30.305,120.165,1124], [30.2775,120.1575,1346], [30.2675,120.1525,1578], [30.275,120.1075,1139], [30.295,120.1025,1216], [30.3025,120.095,1356], [29.4925,119.3275,5021], [30.26,120.2175,1718], [30.1875,120.16,1605], [30.2475,120.1675,1638], [30.1825,120.2075,1088], [30.2025,120.205,1134], [30.28,120.155,1539], [30.2875,120.1475,1372], [30.3325,120.14,1199], [30.305,120.1375,1035], [30.2575,120.1975,1390], [30.2875,120.1925,1577], [30.2175,120.1775,1758], [30.275,120.1225,1994], [30.2675,120.1875,1526], [30.245,120.1775,2059], [30.285,120.1725,1359], [30.2375,120.17,1168], [30.2875,120.165,1442], [30.285,120.115,1873], [30.1175,120.2825,1356], [30.285,120.09,1517], [30.315,120.1675,1393], [30.295,120.105,1300], [30.315,120.1475,1486], [30.2825,120.1375,1822], [30.265,120.1975,1478], [30.265,120.1925,1541], [30.3375,120.19,1004], [30.24,120.175,1415], [30.23,119.7125,1439], [30.2875,120.1,1219], [30.315,120.1825,940], [30.3025,120.1725,1154], [30.275,120.125,1377], [30.295,120.16,2193], [30.3025,120.1525,1005], [30.2675,120.095,1290], [30.2275,120.2,1174], [30.2925,120.1675,1251], [30.165,120.4075,1223], [30.19,120.2,1056], [30.3175,120.105,1221], [30.3325,120.1475,1155], [30.2725,120.1425,1925], [30.28,120.1325,989], [30.2825,120.1975,1259], [30.2425,120.1925,1359], [30.33,120.185,869], [30.2225,120.175,1274], [30.2525,120.1825,1408], [30.26,120.1725,2041], [30.2325,120.1675,1507], [30.2875,120.16,1148], [30.2675,120.1025,1199], [30.2625,120.1575,4780], [30.3075,120.155,1155], [30.29,120.1425,1377], [30.3125,120.0925,1022], [30.2975,120.1325,2081], [30.2775,120.145,1253], [30.0075,120.0,1480], [30.24,120.1725,1568], [30.27,120.1825,1542], [30.2775,120.1725,2358], [30.175,120.165,834], [30.19,120.1625,1092], [30.2875,120.0975,1156], [30.2925,120.11,1210], [30.29,120.155,1033], [30.175,120.1375,1486], [30.315,120.1325,1378], [30.2925,120.135,1552], [30.28,120.0825,2423], [30.275,120.11,1202], [30.275,120.09,1423], [30.285,120.1625,1210], [30.325,120.1425,1169], [30.325,120.085,828], [30.285,120.12,1375], [29.5625,119.375,1385], [30.0925,119.235,1690], [30.315,120.135,1337], [30.255,120.13,1480], [30.1225,120.28,1681], [30.345,120.1875,737], [30.23,120.1925,1480], [30.265,120.16,2022], [30.235,120.1975,1444], [30.315,120.15,1489], [30.3,120.39,979], [30.3175,120.14,1390], [30.245,120.165,1874], [30.23,120.19,1454], [30.2675,120.13,1264], [30.3525,120.2925,1039], [30.2725,120.0975,1285], [30.2875,120.15,1467], [30.3,120.14,1262], [30.2025,120.19,1198], [30.29,120.13,3153], [30.35,120.2925,1224], [29.6125,119.5525,1795], [30.34,120.1825,1054], [30.3225,120.09,901], [30.235,120.195,1486], [30.295,120.385,650], [30.315,120.18,1070], [30.2375,120.2,1390], [30.2975,120.3875,734], [30.3025,120.13,1553], [30.28,120.1175,1402], [30.14,120.16,690], [30.285,120.19,1333], [29.855,119.775,956], [30.3075,120.18,1134], [29.8075,119.6775,1237], [30.3275,120.0825,825], [30.465,120.3075,1120], [30.13,120.165,867], [30.3225,120.3475,1904], [30.25,120.2025,1569], [30.2975,120.19,1160], [30.3125,120.1275,1229], [30.3025,120.3875,1014], [30.3,120.17,1340], [30.1325,120.165,867], [30.2675,120.2075,1327], [30.2,120.21,1144], [30.2275,120.2025,1108], [30.1825,120.195,1380], [30.28,120.19,1362], [30.2625,120.18,2333], [30.3325,120.0875,1218], [30.25,120.22,1139], [30.29,120.1575,1223], [30.2975,120.1075,1025], [30.205,120.27,1470], [30.255,120.2075,1715], [30.1875,120.155,1224], [30.2825,120.195,1322], [30.175,120.265,2785], [30.3325,120.075,802], [30.41,120.305,1628], [30.205,120.2025,1091], [30.2525,120.19,1443], [30.285,120.175,1464], [30.2775,120.1275,1604], [30.3,120.1875,1134], [30.255,120.17,3357], [30.3075,120.1575,1173], [30.285,120.1075,1255], [30.2175,120.27,1172], [30.2725,120.21,1303], [30.2325,120.2075,2229], [30.265,120.2,1362], [30.265,120.195,1570], [30.325,120.145,1064], [30.32,119.535,2210], [30.185,120.1475,947], [30.315,120.185,938], [30.2375,120.18,1433], [30.3075,120.175,1202], [30.315,120.1775,1069], [30.2675,120.17,2591], [30.2775,120.165,1664], [30.315,120.1575,1165], [30.2725,120.1475,1871], [30.2075,120.215,1228], [30.1975,120.2125,1422], [30.295,120.21,1270], [30.1925,120.1575,1662], [30.2475,120.195,1271], [30.2725,120.1375,3747], [30.2575,120.185,1775], [30.25,120.175,2625], [30.2825,120.1225,1208], [30.3,120.385,843], [30.2675,120.215,1365], [30.305,120.125,1550], [30.26,120.165,1752], [30.3175,120.115,1131], [30.2725,120.1525,1258], [30.12,120.285,1356], [30.125,120.2825,1681], [30.19,120.16,2244], [30.2625,120.1675,1878], [30.1975,120.2075,1145], [30.2375,120.205,1647], [30.2625,120.1475,1519], [30.1475,120.335,1312], [29.93,119.925,1183], [30.28,120.185,1489], [30.2325,120.1775,1475], [30.2275,119.715,1330], [30.2425,120.1875,1218], [30.2825,120.1825,2023], [30.28,120.1775,2127], [30.2875,120.125,1146], [30.28,120.1575,1203], [30.27,120.1525,1534], [30.2675,120.1075,1124], [30.2525,120.2175,3868], [30.25,120.1675,1539], [30.2775,120.155,1567], [30.29,120.105,1307], [30.29,120.1475,1670], [30.26,120.1975,1618], [30.29,120.1925,1451], [30.22,120.1775,1272], [30.215,120.175,1404], [30.2775,120.1225,2119], [30.2925,120.1,1215], [30.27,120.1875,1598], [30.2575,120.1775,1997], [30.2875,120.1725,1358], [30.27,120.125,1562], [30.285,120.165,1266], [30.315,120.1025,1221], [30.12,120.2825,1356], [30.2825,120.09,1504], [30.3075,120.1675,1105], [29.775,119.695,1453], [30.2925,120.105,1528], [30.285,120.1375,2740], [30.2775,120.1975,1070], [30.2675,120.1925,1438], [30.2375,120.175,1492], [30.3175,120.125,1073], [30.275,120.1,1205], [30.305,120.1725,1223], [30.2725,120.125,1336], [30.1875,120.165,948], [30.305,120.1525,1081], [29.6025,119.0525,1734], [30.265,120.095,1290], [30.295,120.1675,1253], [30.315,120.105,1221], [30.275,120.1425,1257], [30.1825,120.1375,1144], [30.2325,120.0275,1044], [30.285,120.1975,1323], [30.245,120.1925,1273], [30.255,120.1825,1693], [30.2425,120.1725,1641], [30.235,120.1675,1173], [30.2825,120.1525,1449], [30.27,120.1025,1219], [30.265,120.2125,1209], [30.2525,120.1625,4275], [30.305,120.155,1100], [30.2925,120.1425,1368], [30.3,120.1325,1963], [30.275,120.145,1260], [30.35,120.185,875], [30.3325,120.1875,884], [30.2725,120.1825,1936], [30.28,120.1725,2351], [30.1725,120.165,834], [30.3,120.11,1025], [30.3025,120.0975,1154], [30.2975,120.3375,664], [30.2875,120.155,1261], [30.2775,120.15,1211], [30.28,120.105,1520], [30.3025,120.39,979], [30.27,120.14,2954], [30.31,120.1425,1285], [30.3525,120.185,881], [30.29,120.135,1972], [30.4175,120.1075,1847], [30.2725,120.11,1384], [30.29,120.0975,1367], [30.2875,120.1625,1326], [30.23,120.1975,959], [30.3275,120.1425,1123], [30.175,120.1325,1177], [30.3225,120.085,738], [30.2825,120.12,1194], [30.32,120.145,1370], [30.3125,120.135,1345], [30.4075,120.3075,1628], [30.2625,120.16,2914], [30.2675,120.0975,1281], [30.3125,120.15,1499], [30.305,120.14,876], [30.3225,120.145,1290], [30.275,120.13,1375], [30.1425,120.1225,1687], [30.275,120.0975,1421], [30.295,120.15,1680], [30.2975,120.14,1092], [30.2875,120.13,2980], [29.615,119.5525,1795], [30.3425,120.1825,1298], [30.235,119.7075,1161], [30.33,120.09,888], [30.2325,120.195,1297], [30.3125,120.18,1229], [30.3,120.3875,904], [30.31,120.13,1127], [30.2725,120.1175,1174], [30.26,120.1275,1321], [30.13,120.1675,857], [30.32,120.35,1904], [30.32,120.26,1092], [30.275,120.2025,1784], [30.33,120.15,1220], [30.2825,120.19,1383], [30.0425,119.95,1632], [30.165,120.41,1223], [22.565,113.8825,1292], [29.81,119.6775,1237], [30.285,120.17,1248], [30.2525,120.2025,1349], [30.0925,119.2375,1690], [30.265,120.19,1573], [30.315,120.1275,1175], [30.18,120.275,1590], [30.27,120.2075,1331], [30.3375,120.0925,829], [30.0575,119.945,1402], [30.1975,120.21,1147], [30.23,120.2025,1271], [30.18,120.195,1380], [30.2775,120.19,1344], [30.27,120.18,1664], [30.335,120.0875,758], [30.3,120.175,1180], [30.2925,120.1275,1348], [30.215,120.1825,2638], [30.2475,120.22,1139], [30.2825,120.1575,1528], [30.3,120.1075,1027], [30.2025,120.27,1476], [30.2,120.215,1425], [30.2575,120.21,1559], [30.25,120.2,1505], [30.3225,120.0975,927], [30.3275,120.145,1104], [30.31,120.2675,821], [30.4075,120.305,1628], [30.2075,120.2025,1112], [30.1825,120.1925,1380], [30.26,120.19,1443], [30.2425,120.18,1271], [30.2825,120.175,1810], [30.28,120.1275,2795], [30.2925,120.1875,2100], [30.2325,120.1825,1217], [30.26,120.215,1352], [30.2525,120.17,3217], [30.31,120.1575,1168], [30.18,120.2725,1620], [30.2025,120.2175,1190], [30.235,120.2075,2224], [30.1875,120.1575,1646], [30.2625,120.2,1495], [30.2625,120.195,1433], [30.2675,120.1375,3183], [30.3175,119.535,2210], [30.32,120.255,938], [30.18,120.1925,1385], [30.2775,120.14,2715], [30.3125,120.185,938], [30.305,120.175,1204], [30.2575,120.1275,1509], [30.3075,120.1225,968], [30.315,120.1125,822], [30.275,120.17,2120], [30.21,120.16,1709], [30.2925,120.095,1523], [30.205,120.215,1204], [30.2,120.2125,1431], [30.2775,120.1675,1805], [30.2925,120.21,1270], [30.285,120.2,1346], [30.245,120.195,1390], [30.2775,120.1475,1214], [30.275,120.1375,3196], [30.255,120.185,1773], [30.2175,120.18,2630], [30.2475,120.175,2055], [30.285,120.1225,1252], [30.2925,120.1125,1808], [30.2575,120.1875,1783], [30.265,120.215,1361], [30.2075,120.17,1365], [30.2575,120.165,1959], [30.315,120.115,825], [30.275,120.1525,1215], [30.2825,120.1025,1383], [30.1175,120.285,1356], [30.175,120.2675,2770], [30.2475,120.2175,1139], [30.265,120.1675,1818], [30.2,120.2075,1142], [30.235,120.205,1953], [30.265,120.1475,1490], [30.145,120.335,1312], [30.2775,120.205,1811], [30.295,120.1925,1193], [30.2775,120.185,1532], [30.235,120.1775,1537], [30.29,120.1125,1808], [30.245,120.1875,1314], [30.285,120.1825,2395], [30.2725,120.1775,4054], [30.2925,120.1725,1667], [30.285,120.125,1228], [30.2725,120.1575,1478], [30.27,120.1075,1355], [30.2425,120.1675,1791], [30.275,120.155,1583], [30.2875,120.105,1473], [30.2825,120.1475,1865], [30.26,120.205,1466], [30.2525,120.1975,1485], [30.2125,120.175,1291], [30.28,120.1225,1063], [30.2625,120.1875,1534], [30.26,120.1775,1926], [30.29,120.1725,1583], [30.2675,120.125,3653], [30.2825,120.165,2056], [30.28,120.115,1737], [30.3175,120.1025,1221], [30.28,120.095,1914], [30.2175,120.2225,1100], [30.31,120.1675,1108], [30.1925,120.2,1098], [29.7725,119.6975,1453], [29.7725,119.695,1453], [30.31,120.1475,1493], [30.2975,120.1375,1045], [30.235,120.175,1464], [30.3075,120.1725,1223], [30.185,120.17,1552], [30.3,120.16,1176], [30.3075,120.1525,1152], [30.005,120.0025,1480], [30.3275,120.1475,1102], [30.2775,120.1425,1251], [30.185,120.1375,1153], [30.235,120.0275,1044], [30.32,119.5325,2210], [30.2475,120.1925,1335], [30.27,120.145,1252], [30.2575,120.1825,1840], [30.245,120.1725,1892], [30.285,120.1525,1504], [30.2725,120.1025,1228], [30.2675,120.2125,1212], [30.255,120.1625,3871], [30.3025,120.155,1110], [30.2625,120.15,2212], [30.275,120.14,3055], [30.295,120.1425,1187], [30.2825,120.1325,1293], [30.275,120.12,1708], [30.22,120.2275,1426], [30.225,120.1725,1538], [30.335,120.1875,990], [30.275,120.1825,1875], [30.2625,120.1725,2035], [30.2975,120.11,1026], [30.305,120.0975,1154], [30.0425,119.9525,1632], [30.23,120.2,1328], [30.2775,120.105,1242], [30.2675,120.14,2955], [30.3125,120.1425,1270], [30.235,120.025,1044], [30.295,120.145,1260], [30.2875,120.135,3262], [30.42,120.1075,1847], [30.1725,120.1625,913], [30.28,120.11,1662], [30.2825,120.0975,1721], [30.28,120.09,1189], [30.29,120.1625,1374], [30.33,120.1425,1119], [30.2725,120.0925,1549], [30.1775,120.1325,1194], [30.34,120.085,962], [30.29,120.12,1381], [30.0375,120.1475,863], [30.3175,120.145,1356], [30.26,120.13,1365], [30.41,120.3075,1628], [30.27,120.16,1775], [30.0375,120.15,863], [30.27,120.0975,1291], [30.3025,120.14,1180], [30.235,120.19,1334], [30.2725,120.13,2941], [30.145,120.1225,1687], [30.2925,120.15,2109], [30.285,120.14,1647], [30.2175,120.1875,5133], [30.295,120.13,1437], [30.1975,120.22,970], [30.34,120.185,1055], [30.3275,120.09,843], [30.045,119.95,1632], [30.3075,120.13,1120], [30.275,120.1175,1153], [30.3175,120.26,1092], [30.2775,120.2025,1811], [30.3275,120.15,1206], [30.2325,120.1925,1480], [30.29,120.19,1635], [30.3225,120.0925,896], [30.2225,120.1875,1722], [30.275,120.165,1830], [30.2825,120.17,1396], [30.2925,120.1175,1427], [30.1825,120.21,1088], [30.255,120.2025,1162], [30.095,119.2375,1690], [30.2625,120.19,1442], [30.275,120.18,2309], [30.3075,120.1275,1251], [30.305,120.17,1166], [30.1775,120.275,1613], [30.255,120.2,1113], [29.9325,119.9275,1183], [30.055,119.945,1426], [30.205,120.21,1162], [30.285,120.185,1436], [30.2675,120.18,1477], [30.3275,120.0875,845], [30.2975,120.175,1092], [30.295,120.1275,1437], [30.2175,120.1825,2638], [30.3175,120.17,1401], [30.285,120.1575,1263], [30.2925,120.1075,1726], [30.1975,120.215,1380], [30.2325,120.2,1379], [30.265,120.21,1093], [30.2475,120.2,1271], [30.2775,120.195,1163], [30.325,120.0975,912], [30.2575,120.19,1515], [30.25,120.18,1450], [30.2725,120.1275,2085], [30.3025,120.0925,1463], [30.295,120.1875,1676], [30.2575,120.215,1354], [30.26,120.17,2195], [30.27,120.165,1555], [30.3025,120.1575,1142], [30.33,120.1025,825], [30.2025,120.2675,1458], [30.205,120.2175,1204], [30.19,120.1575,1624], [30.27,120.2,1219], [30.26,120.195,1307], [30.27,120.1375,3201], [30.3175,120.255,938], [30.25,120.185,1443], [30.3025,120.175,1207], [30.31,120.1225,969], [30.3175,120.1125,1131], [30.2375,120.1625,2055], [30.2725,120.17,1604], [30.2075,120.16,1530], [30.29,120.095,1523], [30.2025,120.215,1212], [30.28,120.1675,1467], [30.23,120.205,1464], [30.2825,120.2,1330], [30.2425,120.195,1524], [30.28,120.1475,1444], [30.2525,120.185,1558], [30.245,120.175,2053], [30.2875,120.1225,1154], [30.26,120.1875,1802], [30.2675,120.1775,1698], [30.255,120.165,3065], [30.2675,120.1575,1896], [30.2775,120.1525,1739], [30.285,120.1025,1467], [30.1775,120.27,2838], [30.25,120.2175,2913], [30.2575,120.1675,2065], [30.2325,120.205,1924], [30.275,120.205,1573], [30.2475,120.1975,1348], [30.2975,120.1925,1227], [30.275,120.185,1867], [30.2675,120.175,1674], [30.145,120.12,1687], [30.2725,120.1125,1495], [30.305,120.1,1354], [30.2775,120.1875,1643], [30.275,120.1775,4029], [30.295,120.1725,1623], [30.2825,120.125,1281], [30.2325,119.7075,1161], [30.275,120.1575,1672], [30.245,120.1675,1762], [30.18,120.2075,1088], [30.2725,120.155,1581], [30.285,120.105,1459], [30.285,120.1475,1617], [30.3125,120.1375,1201], [30.2575,120.205,1443], [30.255,120.1975,1350], [30.275,120.1925,1288], [30.27,120.1125,1529], [30.265,120.1875,1281], [30.2525,120.1775,1756], [30.265,120.125,3544], [30.185,120.16,1772], [30.2775,120.115,1264], [30.22,120.2225,1105], [30.2625,120.1625,1666], [29.775,119.6975,1453], [30.3,120.1375,998], [30.3325,120.145,1155], [30.2725,120.1975,1323], [30.2525,120.1925,1428], [30.2325,120.175,1479], [30.2125,120.1725,1253], [30.3175,119.5325,2210],
      ]

      for(var i=0,l=data.length; i<l; i++) {
        heatmap.pushData(data[i][0], data[i][1], data[i][2]);
      }


      //title
      var titleDiv=document.createElement("div");
      titleDiv.style.height='68px';
      titleDiv.style.width='800px';
      map.controls[google.maps.ControlPosition.TOP_LEFT].push(document.getElementById('titleImg').cloneNode(true));

      //add close and refresh
      var closeDiv = document.createElement('DIV');
      // Set CSS for the control border
      //closeDiv.style.backgroundColor = 'white';
      //closeDiv.style.borderStyle = 'solid';
      //closeDiv.style.borderWidth = '2px';
      closeDiv.style.cursor = 'pointer';
      closeDiv.style.textAlign = 'center';
      //closeDiv.title = 'Click to exit';
      closeDiv.style.height='100px';
      closeDiv.style.width='300px';
      closeDiv.appendChild(document.getElementById('pageControl').cloneNode(true));
      map.controls[google.maps.ControlPosition.TOP_RIGHT].push(closeDiv);



      //slider
      var mainCanvas=document.createElement("canvas");
      var rootElement=document.getElementById("map");
      //rootElement.appendChild(mainCanvas);
      slider=new HeatSlider(mainCanvas, rootElement);
      setTimeout(function(){
        slider.setValues(defaultrangemin,defaultrangemax,originmin,originmax);
      },800);
      slider.stop=function() {
        slider.disable();
        //HeatOverlay.heatmap.wait();//
        setTimeout(function(){
          HeatOverlay.heatmap._adjust(slider.values[0],slider.values[1]);
          //HeatOverlay.heatmap.endWait();
        },400);
      }
      slider.enable();
      map.controls[google.maps.ControlPosition.RIGHT].push(mainCanvas);



      //hide debug div
      $('#debug').hide();
      $('#pageControl').hide();
      $('#titleImg').hide();
    }

    //debug div function
    function initCanvas2Image(){
      //convert to image
      var bMouseIsDown = false;
      var oCanvas = HeatOverlay.heatmap.canvas;
      /*var oCanvas = document.getElementById("thecanvas");
      var oCtx = oCanvas.getContext("2d");
      var iWidth = oCanvas.width;
      var iHeight = oCanvas.height;
      oCtx.fillStyle = "rgb(255,255,255)";
      oCtx.fillRect(0,0,iWidth,iHeight);
      oCtx.fillStyle = "rgb(255,0,0)";
      oCtx.fillRect(20,20,30,30);
      oCtx.fillStyle = "rgb(0,255,0)";
      oCtx.fillRect(60,60,30,30);
      oCtx.fillStyle = "rgb(0,0,255)";
      oCtx.fillRect(100,100,30,30);
      oCtx.beginPath();
      oCtx.strokeStyle = "rgb(255,0,255)";
      oCtx.strokeWidth = "4px";*/

      function showDownloadText() {
        document.getElementById("buttoncontainer").style.display = "none";
        document.getElementById("textdownload").style.display = "block";
      }
      function hideDownloadText() {
        document.getElementById("buttoncontainer").style.display = "block";
        document.getElementById("textdownload").style.display = "none";
      }
      function convertCanvas(strType) {
        if (strType == "PNG")
          var oImg = Canvas2Image.saveAsPNG(oCanvas, true);
        if (strType == "BMP")
          var oImg = Canvas2Image.saveAsBMP(oCanvas, true);
        if (strType == "JPEG")
          var oImg = Canvas2Image.saveAsJPEG(oCanvas, true);
        if (!oImg) {
          alert("Sorry, this browser is not capable of saving " + strType + " files!");
          return false;
        }
        oImg.id = "canvasimage";
        oImg.style.border = oCanvas.style.border;
        oCanvas.parentNode.replaceChild(oImg, oCanvas);
        showDownloadText();
      }
      function saveCanvas(pCanvas, strType) {
        var bRes = false;
        if (strType == "PNG")
          bRes = Canvas2Image.saveAsPNG(oCanvas);
        if (strType == "BMP")
          bRes = Canvas2Image.saveAsBMP(oCanvas);
        if (strType == "JPEG")
          bRes = Canvas2Image.saveAsJPEG(oCanvas);
        if (!bRes) {
          alert("Sorry, this browser is not capable of saving " + strType + " files!");
          return false;
        }
      }
      document.getElementById("savepngbtn").onclick = function() {
        saveCanvas(oCanvas, "PNG");
      }
      document.getElementById("savebmpbtn").onclick = function() {
        saveCanvas(oCanvas, "BMP");
      }
      document.getElementById("savejpegbtn").onclick = function() {
        saveCanvas(oCanvas, "JPEG");
      }
      document.getElementById("convertpngbtn").onclick = function() {
        convertCanvas("PNG");
      }
      document.getElementById("convertbmpbtn").onclick = function() {
        convertCanvas("BMP");
      }
      document.getElementById("convertjpegbtn").onclick = function() {
        convertCanvas("JPEG");
      }
      document.getElementById("resetbtn").onclick = function() {
        var oImg = document.getElementById("canvasimage");
        oImg.parentNode.replaceChild(oCanvas, oImg);
        hideDownloadText();
      }
    }//end of initCanvas2Image
  </script>
</head>

<body onload="init();">
<img id="wait_logo" src="images/wait_logo.gif" width="100" height="100" ></img>
<div id="map"  style="position:absolute;  margin: 0; padding: 0;"></div>

<div id="pageControl" style="position: relative; top:0px; left:80px; width: 100px; height: 100px;  display:inline">
  <button id="refresh" type="submit" style="border: 0; background: transparent"  onclick="refresh()"
          style="position: absolute; left: 0px; top: 0px; padding:0px; margin:0px;" title="refresh">
    <img src="images/rent06another.png" width="50" heght="50" alt="submit" />
  </button>
  <button id="close" type="submit" style="border: 0; background: transparent"  onclick="javascript:window.opener=null;window.close();"
          style="position: absolute; left: 50px; top: 0px; padding:0px; margin:0px" title="click to exit">
    <img src="images/rent07another.png" width="50" heght="50" alt="submit" />
  </button>
</div>

<img id="titleImg" src="images/rent10.png" width="1216" height="68" alt="titleImg" />

<div id="debug" style="position: absolute; top: 1920px">
  <div id="loc">Loc and pixel</div>
  <div id="info">point number</div>
  <div id="max_value">max value</div>
  <div id="info2">info2</div>
  <div id="info3">info3</div>
  <div id="info4">info4</div>
  <div id="info5">info5</div>
  <div id="info6">info6</div>

  <br>
  <canvas id="thecanvas" style="border:1px solid black;" height="200" width="200"></canvas>
  <br>
  <div id="textdownload" style="display:none;font-style:italic;">
    Now you can right click and download the image
    <br>
    <input id="resetbtn" type="button" value="Reset">
  </div>
  <div id="buttoncontainer" style="display:block;">
    <input id="savepngbtn" type="button" value="Save PNG">
    <input id="convertpngbtn" type="button" value="Convert to PNG">
    <br>
    <input id="savebmpbtn" type="button" value="Save BMP">
    <input id="convertbmpbtn" type="button" value="Convert to BMP">
    <br>
    <input id="savejpegbtn" type="button" value="Save JPEG">
    <input id="convertjpegbtn" type="button" value="Convert to JPEG">
  </div>
</div>

</body>

</html>
